package com.Interface.pa;

import java.util.Scanner;

public class Test4 {
    public static Scanner scanner = new Scanner(System.in);

    public static void find() {
        int count=0;
        System.out.println("请输入一个字符串：");
        String inputString = scanner.next();
        System.out.println("请输入要查询的字符");
        String find = scanner.next();

        String[] string = new String[100];
        for (int i = 0; i < inputString.length(); i++) {
            string[i] = inputString.substring(i, i++);
        }
        for (int i = 0; i < string.length; i++) {
            if (string[i] != null && string[i].equals(find)) {
                count++;
            }
        }
        System.out.println(count);

    }

    public static void main(String[] args) {
        find();
    }
}
